// 获取参数
export function getParams(obj) {
  // console.log(obj, 'obj')
  const searchParams = {};
  const {
    type = 1, // 参数类型 1-带分页 2-不带分页
    data = {}, // form字段
    pageSize = 1, // 页码
    pageNum = 10, // 页数
  } = obj;
  for (const key in data) {
    if (data.hasOwnProperty(key)) {
      searchParams[key] = data[key] || null;
    }
  }
  const pageParams = {
    pagesize: pageSize,
    pagenum: pageNum,
  };
  const params = {
    ...searchParams,
    ...pageParams,
  };
  let reParams = {};
  if (type === 1) {
    reParams = params;
  } else if (type === 2) {
    reParams = searchParams;
  }
  // console.log(reParams, 'reParams')
  return reParams;
}
